<{include file="element/inc_header.html"}>

<div id="talkbox">
	<div id="talklist">
		<img src="index/www/img/info_1.png" class="minfo"/>
<{if $xielie==0}>
		<div id="line_1" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1"><p>准备换套房子租,押一付三还差不少。</p></div>
		</div>
		<img id="line_2" src="index/www/img/info_1.png" class="minfo thd"/> 
		<div id="line_3" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1"><p>借我点钱周转，下个月一定还！</p></div>
		</div> 
<{/if}>
<{if $xielie==1}>
		<div id="line_1" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1"><p>买过头了，信用卡快刷爆了！</p></div>
		</div>
		<img id="line_2" src="index/www/img/info_1.png" class="minfo thd"/> 
		<div id="line_3" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1"><p>亲，先借我点软妹币,还卡账吧？</p></div>
		</div> 
<{/if}>
<{if $xielie==2}>
		<div id="line_1" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1 tkbg3"><p>下周要带女票去做小手术额，你懂的。</p></div>
		</div> 
		<img id="line_2" src="index/www/img/info_1.png" class="minfo thd"/> 
		<div id="line_3" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1"><p>借我点钱呗</p></div>
		</div> 
<{/if}>
<{if $xielie==3}>
		<div id="line_1" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1 tkbg3"><p>好心扶个爷爷过红绿灯,TMD 中招了！</p></div>
		</div>
		<img id="line_2" src="index/www/img/info_1.png" class="minfo thd"/> 
		<div id="line_3" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1"><p>借我点“赔偿金”好么</p></div>
		</div> 
<{/if}>
<{if $xielie==4}>
		<div id="line_1" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1"><p><{$gm.word}></p></div>
		</div> 
		<img id="line_2" src="index/www/img/info_1.png" class="minfo thd"/> 
		<div id="line_3" class="tk tk_left thd">
			<img src="<{$user.headimgurl}>" class="head">
			<div class="tkbg1"><p>借我点钱呗</p></div>
		</div>
<{/if}>
		<div id="line_money" class="tk tk_right thd">
			<img src="<{$my.headimgurl}>" class="head">
			<div class="tkbg2"></div>
		</div>
		<img id="line_money_info" src="index/www/img/info_1.png" class="minfo thd"/>
	</div>
		<div id="write_box">
			<div id="val">请输入金额</div>
			<div id="sub_btn"></div>
			<div class="k_box">
				<u v="1" class="k"></u>
				<u v="2" class="k"></u>
				<u v="3" class="k"></u>
				<u v="4" class="k"></u>
				<u v="5" class="k"></u>
				<u v="6" class="k"></u>
				<u v="7" class="k"></u>
				<u v="8" class="k"></u>
				<u v="9" class="k"></u>
				<u v="." class="k"></u>
				<u v="0" class="k"></u>
				<u v="-" class="k"></u> 
			</div>
		</div>
		
		<div id="pop_mark1"></div>
		<div id="pop_box1"> 
			<div><p>愿意援助这位苦逼小伙伴吗？</p></div>
			<div class="wt2btn">
				<span class="btn fl" >随便打个赏</span>
				<span class="btn fr" id="zjymq_btn">最近也没钱</span>
			</div>
		</div>
		
		<div id="pop_info1">
			<h3>微信安全中心提醒您</h3>
			为了您的资金安全， <br />单次转账金额请少于1000元。
		</div>
		<div id="pop_info2">
			<h3>放心</h3>
			并没有真的扣你的钱啦<br />谢谢援助~
		</div>
		
		<div id="pop_result">
			<div id="pop_result_body">
				<div class="pop_r_hed">
					<img  src="<{$user.headimgurl}>" />
					<h2><{$user.nickname}></h2>
				</div>
				<div id="pop_m_txt">
					<img src="index/www/img/result_txt.png" />
				</div>
				<div class="pop_2_btn" >
					<span id="btn_return_play" class="fl">回去陪TA玩玩</span>
					<span id="btn_toplay" class="fr">自己去测测</span>
				</div>
			</div>
		</div>
		
</div> 
<script type="text/javascript">
var tindex = 1;
function showText(){
	setTimeout(function(){
		$('#line_'+tindex++).show();
		if($('#line_'+tindex).length<1){
			$('#write_box').show();
		}else{
			showText(tindex);
		}
	},1400);
}

$(function(){
	document.body.addEventListener('touchmove', function(event) { event.preventDefault(); }, false); 
	showText();
	
	$('#val').click(function(){
		$('#write_box').animate({bottom:'0px'},100);  
		if(!(parseFloat($(this).val())>0)){
			$(this).text('');
			$('#pop_mark1 , #pop_box1').fadeIn();
		} 
	});
	
	$('.k_box .k').click(function(){
		var k = $(this).attr('v');
		var vl= getVal(); 
		if(k=='-'){ 
			if(vl.length==1){
				vl = '请输入转账金额';
			}else{
				vl = vl.substr(0,vl.length-1);
			} 
		}else{ 
			if(vl.length>5)
				return false;
			vl += k;
		}
		setVal(vl); 
	}); 
	
	$('.wt2btn .btn').click(function(){
		$('#pop_mark1 , #pop_box1').fadeOut(); 
	});
	
	$('#zjymq_btn').click(function(){
		$('#pop_mark1 , #pop_result').fadeIn(); 
	});
	
	$('#sub_btn').click(function(){
		var val =  getVal();
		if(val.length<1){
			alert('请输入金额');
		}
		val = parseFloat(getVal()); 
		if(val==NaN){
			alert('请输入金额有误');
		}
		if(val>1000){
			$('#pop_mark1 , #pop_info1').fadeIn(); 
			setTimeout(function(){
				$('#pop_mark1 , #pop_info1').fadeOut(); 
			},2000);
			return false;
		} 
		$.post('/index.php/main/saveMoney',{'openid':'<{$openid}>','gid':'<{$gid}>','money':val},function(rs){
			var obj = eval('('+rs+')');
			if(!obj.s){
				alert(obj.m); return false;
			}
			$('#write_box').animate({bottom:'-410px'},100,function(){
				$('#line_money_info,#line_money').show();
				setTimeout(function(){
					$('#pop_info2').show();
					setTimeout(function(){
						location.href = '/index.php/main/result/gid/<{$gid}>/money/'+val;
					},2000);
				},1000);
			});  
		});
	});
	
	$('#btn_return_play').click(function(){
		$('#pop_mark1 , #pop_box1').fadeOut(); 
		$('#pop_mark1 , #pop_result').fadeOut(); 
	});
	
	$('#btn_toplay').click(function(){
		location.href = '/index.php/main/index';
	});
	
});
function setVal(val){
	$('#val').text(val);
} 
function getVal(){
	return $('#val').text();
}
</script>
<!-- 微信分享 Start -->
<!--
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script language="javascript">
var sTitle = '分享标题';
var sDesc = '分享文案！';
var sImg = 'http://car.1dospace.com/index/www/img/share.jpg';
var sLink = location.href;
</script>
<{include file="element/inc_share.html"}>
-->
<!-- 微信分享 End -->
<{include file="element/inc_footer.html"}>